#include <modules\system\system_timer.h>

namespace DelGE
{
	namespace Modules
	{
		namespace System
		{
			SystemTimer::SystemTimer()
			{
				this->pInterface = new InterfaceSystemTimer();
			}

			SystemTimer::~SystemTimer()
			{
				delete ((InterfaceSystemTimer*)this->pInterface);
				this->pInterface = NULL;
			}

			void SystemTimer::Start()
			{
				this->pInterface->Start();
			}

			void SystemTimer::Stop()
			{
				this->pInterface->Stop();
			}

			float SystemTimer::GetDeltaTime()
			{
				return this->pInterface->GetDeltaTime();
			}

			float SystemTimer::GetStartTime()
			{
				return this->pInterface->GetStartTime();
			}

			float SystemTimer::GetEndTime()
			{
				return this->pInterface->GetEndTime();
			}

			float SystemTimer::GetCurrentTime()
			{
				return this->pInterface->GetCurrentTime();
			}

			void SystemTimer::Restart()
			{
				this->pInterface->Restart();
			}

			InterfaceSystemTimer* SystemTimer::GetInterfaceTimer() const
			{
				return this->pInterface;
			}

			bool operator ==(const SystemTimer &pTimer0, const SystemTimer &pTimer1)
			{
				return (pTimer0.GetInterfaceTimer() == pTimer1.GetInterfaceTimer());
			}

			bool operator !=(const SystemTimer &pTimer0, const SystemTimer &pTimer1)
			{
				return !(pTimer0 == pTimer1);
			}
		}
	}
}